(function (angular) {
    'use strict';

    var BASE_URL = 'http://localhost:8080/api';

    angular.module('ytong.services').constant('Constants', {

        QUERY_RESULTS:{
            ERROR: 0,
            SUCCESS: 1,
            NO_RESULTS: 2
        },

        USERS:{
            ADMIN: 'admin',
            SALESMAN: 'salesman',
            MANAGER: 'manager'
        },

        ROLES:{
            UNAUTHORIZED: '-1',
            ADMIN: '0',
            MANAGER: '1',
            SALESMAN: '2'
        },

        RESOURCES:{
            TRUCKS: 'truck',
            CRANES: 'crane',
            PRODUCTS: 'product',
            AREAS: 'area'
        },

        REPORTS:{
            ORDERS: 'orders',
            LATE: 'late'
        },

        STATES: {
            ANONYMOUS: 'anonymous',
            LOGIN: 'anonymous.login',
            REGISTER: 'anonymous.register',

            ADMIN:{
                ADMIN: 'admin',
                DASHBOARD: 'admin.dashboard',
                AUTHORIZE: 'admin.authorize',
                USERS: 'admin.users',
                FEEDBACKS: 'admin.feedbacks',
                MESSAGES: 'admin.messages'
            },
            SALESMAN:{
                SALESMAN: 'salesman',
                DASHBOARD: 'salesman.dashboard',
                MESSAGES: 'salesman.messages',
                CUSTOMERS: 'salesman.customers',
                ORDERS: 'salesman.orders',
                ORDER: 'salesman.order'
            },
            MANAGER:{
                MANAGER: 'manager',
                DASHBOARD: 'manager.dashboard',
                MESSAGES: 'manager.messages',
                ORDERS: 'manager.orders',
                ORDER: 'manager.order',
                RESOURCES_DASH: 'manager.resources_dash',
                RESOURCES:{
                    TRUCKS: 'manager.resources_truck',
                    CRANES: 'manager.resources_cranes',
                    PRODUCTS: 'manager.resources_products',
                    AREAS: 'manager.resources_areas'
                },
                REPORTS_DASH: 'manager.reports_dash',
                REPORTS:{
                    ORDERS: 'manager.reports_orders',
                    LATES: 'manager.reports_lates'
                }
            }
        },

        URLS: {
            LOGIN_URL: BASE_URL + '/login',
            AUTHORIZATION_URL: BASE_URL + '/authorization',
            FEEDBACK_URL: BASE_URL + '/feedback',
            CUSTOMERS_URL: BASE_URL + '/customers',
            TRUCKS_URL: BASE_URL + '/trucks',
            CRANES_URL: BASE_URL + '/cranes',
            PRODUCTS_URL: BASE_URL + '/products',
            AREAS_URL: BASE_URL + '/areas',
            ORDERS_URL: BASE_URL + '/orders',
            ORDERS_DASHBOARD_URL: BASE_URL + '/orders_dashboard',
            FEEDBACKS_REPORT_URL: BASE_URL + '/feedbacks_report'
        },

        COMMANDS: {
            NONE: 'none',
            ADD: 'add',
            UPDATE: 'update',
            DELETE: 'delete'
        },

        ORDER_STATUS:{
            OPEN: '0',
            CLOSED: '1',
            IN_PROGRESS: '2'
        },

        LINE_IN_ORDER_STATUS:{
            PENDING_DELIVERY:  '0',
            DELIVERY_SCHEDULED: '1',
            DELIVERED: '2',
            RETURNED: '3'
        }
    });

}(angular));